package com.zhongfeng.api.modules.white;

import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class DeleteNumber {
    public static void main(String[] args) throws IOException {
        String location = "C:\\Users\\84361\\Desktop\\deal";
        String old = "C:\\Users\\84361\\Desktop\\deal\\原号码.txt";
        String forbidden = "C:\\Users\\84361\\Desktop\\deal\\禁用号码.txt";
        List<String> oldList = new ArrayList<>();
        List<String> forbiddenList = new ArrayList<>();
        List<String> result = new ArrayList<>();
        Scanner sc = new Scanner(new FileReader(old));
        while (sc.hasNextLine()){
            oldList.add(sc.nextLine());
        }
        System.out.println(oldList.size());
        sc = new Scanner(new FileReader(forbidden));
        while (sc.hasNextLine()){
            forbiddenList.add(sc.nextLine());
        }
        System.out.println(forbiddenList.size());
        for (String s : oldList) {
            if (!forbiddenList.contains(s)){
                result.add(s);
            }
        }
        System.out.println(result.size());
        FileWriter fw = new FileWriter(location + "\\去掉禁用号码.txt");
        for (String s : result) {
            fw.write(s+"\n");
        }
        fw.flush();
        fw.close();
    }
}
